// ==========================================================================
// gin-sns auto gen code.
// date：2021-02-21 13:45:54 +0800 CST
// path: app/model/module/rss/rss_entity.go
// author：jon
// ==========================================================================

package rss

import (
	"time"
)

// 数据表映射结构体
type Entity struct {
	Id          int64     `json:"id" xorm:"not null pk autoincr comment('') bigint(20)"`
	Category    string    `json:"category" xorm:"comment('分类') text"`
	UserId      int64     `json:"user_id" xorm:"comment('创建用户') bigint(20)"`
	Title       string    `json:"title" xorm:"comment('标题') varchar(255)"`
	Description string    `json:"description" xorm:"comment('描述') varchar(1024)"`
	IconUrl     string    `json:"icon_url" xorm:"comment('封面URL') varchar(1024)"`
	Url         string    `json:"url" xorm:"comment('RSS URL') varchar(512)"`
	CountPost   int64     `json:"count_post" xorm:"comment('文章数量') bigint(20)"`
	CountFollow int64     `json:"count_follow" xorm:"comment('被关注数量') bigint(20)"`
	Status      int       `json:"status" xorm:"comment('0未审核 1正常状态 2审核未通过 3删除') tinyint(2)"`
	CreateTime  time.Time `json:"create_time" xorm:"comment('创建时间') datetime"`
	UpdateTime  time.Time `json:"update_time" xorm:"comment('更新时间') datetime"`
}

//新增页面请求参数
type AddReq struct {
	Category    string `form:"category" `
	UserId      int64  `form:"userId" `
	Title       string `form:"title" `
	Description string `form:"description" `
	IconUrl     string `form:"iconUrl" `
	Url         string `form:"url" `
	CountPost   int64  `form:"countPost" `
	CountFollow int64  `form:"countFollow" `
	Status      int    `form:"status" binding:"required"`
}

//修改页面请求参数
type EditReq struct {
	Id          int64  `form:"id" binding:"required"`
	Category    string `form:"category" `
	UserId      int64  `form:"userId" `
	Title       string `form:"title" `
	Description string `form:"description" `
	IconUrl     string `form:"iconUrl" `
	Url         string `form:"url" `
	CountPost   int64  `form:"countPost" `
	CountFollow int64  `form:"countFollow" `
	Status      int    `form:"status" binding:"required不能为空"`
}

//分页请求参数
type SelectPageReq struct {
	Category    string `form:"category"`    //分类
	UserId      int64  `form:"userId"`      //创建用户
	Title       string `form:"title"`       //标题
	Description string `form:"description"` //描述
	IconUrl     string `form:"iconUrl"`     //封面URL
	Url         string `form:"url"`         //RSS URL
	CountPost   int64  `form:"countPost"`   //文章数量
	CountFollow int64  `form:"countFollow"` //被关注数量
	Status      int    `form:"status"`      //0未审核 1正常状态 2审核未通过 3删除
	BeginTime   string `form:"beginTime"`   //开始时间
	EndTime     string `form:"endTime"`     //结束时间
	PageNum     int    `form:"pageNum"`     //当前页码
	PageSize    int    `form:"pageSize"`    //每页数
}
